# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        黄周云  
# Name:         test02
# Description:  例12.7
# Author:       ASUS
# Date:         2019/3/27
#-------------------------------------------------------------------------------


a = set([1,2])
b = set([10,20])
a.add(4)
print(a)
#集合b不能作为元素添加进集合a
#a.add(b)
a.add(frozenset(b))
print(a)

d = {"Bill":30,"Mike":40}
#集合a不能作为字典的key
#d[a] = 60
d[frozenset(a)] = 60
print(d)

t = [1,2,3]
tt = (1,2,3)
#列表、字典不能作为集合的元素和字典的key
#d[t] = 111
#a.add(t)
#a.add(d)
#元组可以作为集合的元素和字典的key
a.add(tt)
print(a)
d[tt] = 222
print(d)